<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/13 0013
 * Time: 上午 10:57
 */
namespace app\api\controller;

use app\common\validate\SmsValidate;
use think\Request;

class Sms{
    public function sendsms(Request $request){
        (new SmsValidate())->goCheck();
        $param = $request->param();
//        if($param['client_key'] != config('sms.client_key')){
//            return show(config('status.ERROR_STATUS'),'客户端密钥错误','客户端密钥错误');
//        }
        $Sms = new \app\common\lib\Sms();
        $result = $Sms->send($param['phone']);

        if($result['errmsg'] == 'OK'){
            return show(config('status.SUCCESS_STATUS'),'短信发送成功',$result);
        }else{
            return show(config('status.ERROR_STATUS'),'短信发送失败','短信发送失败');
        }

    }
}